package com.rzl.expense.expense.service.impl;

import java.util.List;
import com.rzl.expense.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rzl.expense.expense.mapper.DatContractMapper;
import com.rzl.expense.expense.domain.DatContract;
import com.rzl.expense.expense.service.IDatContractService;

/**
 * 主合同Service业务层处理
 * 
 * @author expense
 * @date 2024-11-28
 */
@Service
public class DatContractServiceImpl implements IDatContractService 
{
    @Autowired
    private DatContractMapper datContractMapper;

    /**
     * 查询主合同
     * 
     * @param contractId 主合同主键
     * @return 主合同
     */
    @Override
    public DatContract selectDatContractByContractId(String contractId)
    {
        return datContractMapper.selectDatContractByContractId(contractId);
    }

    /**
     * 查询主合同列表
     * 
     * @param datContract 主合同
     * @return 主合同
     */
    @Override
    public List<DatContract> selectDatContractList(DatContract datContract)
    {
        return datContractMapper.selectDatContractList(datContract);
    }

    /**
     * 新增主合同
     * 
     * @param datContract 主合同
     * @return 结果
     */
    @Override
    public int insertDatContract(DatContract datContract)
    {
        datContract.setCreateTime(DateUtils.getNowDate());
        return datContractMapper.insertDatContract(datContract);
    }

    /**
     * 修改主合同
     * 
     * @param datContract 主合同
     * @return 结果
     */
    @Override
    public int updateDatContract(DatContract datContract)
    {
        datContract.setUpdateTime(DateUtils.getNowDate());
        return datContractMapper.updateDatContract(datContract);
    }

    /**
     * 批量删除主合同
     * 
     * @param contractIds 需要删除的主合同主键
     * @return 结果
     */
    @Override
    public int deleteDatContractByContractIds(String[] contractIds)
    {
        return datContractMapper.deleteDatContractByContractIds(contractIds);
    }

    /**
     * 删除主合同信息
     * 
     * @param contractId 主合同主键
     * @return 结果
     */
    @Override
    public int deleteDatContract()
    {
        return datContractMapper.deleteDatContract();
    }




    @Override
    public void batchDatContract(List<DatContract> list)
    {

         datContractMapper.batchDatContract(list);
    }


}
